package com.example.helloworld.handler;

import android.os.Handler;
import android.os.Message;
import android.util.Log;
import android.widget.TextView;

import androidx.annotation.NonNull;

public class TextViewChangeHandler extends Handler {

    private TextView textView;

    public TextViewChangeHandler(TextView textView){
        this.textView = textView;
    }

    public TextView getTextView() {
        return textView;
    }

    @Override
    public void handleMessage(@NonNull Message msg) {
        Log.e("TextViewChangeHandler","handleMessage执行了...");
        if(textView == null){
            Log.e("TextViewChangeHandler","textView is null");
            return;
        }
        textView.setText("aa");
    }
}
